using UniversalAdmin.Domain.Common;
using UniversalAdmin.Domain.Entities;

namespace UniversalAdmin.Domain.Events;


// 用户创建事件 - 当新用户注册时触发
public record UserCreatedEvent(User User) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
    public string Email => User.Email;
}


// 用户档案更新事件 - 当用户更新个人信息时触发
public record UserProfileUpdatedEvent(User User) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
}


// 用户密码变更事件 - 当用户修改密码时触发
public record UserPasswordChangedEvent(User User) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
}

// 用户角色分配事件 - 当为用户分配新角色时触发
public record UserRoleAssignedEvent(User User, Role Role) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
    public int RoleId => Role.Id;
    public string RoleName => Role.Name;
}

// 用户角色移除事件 - 当移除用户角色时触发
public record UserRoleRemovedEvent(User User, int RoleId) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
}

// 用户激活事件 - 当用户账户被激活时触发
public record UserActivatedEvent(User User) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
}

// 用户停用事件 - 当用户账户被停用时触发
public record UserDeactivatedEvent(User User) : DomainEvent
{
    public int UserId => User.Id;
    public string Username => User.Username;
}
